package com.aotain.oframework.util.json;

import java.util.LinkedList;
import java.util.List;

public class JqGridBean implements java.io.Serializable {

	private static final long serialVersionUID = 6575182940881770296L;
	private int records = 0;
	private int page = 0;
	private int total = 0;
	private List rows = new LinkedList();
	private JqGridUserData userdata;

	/**
	 * 添加一行记录
	 * @param row 输出的记录
	 * @return 当前数据源,方便链式写法 ds.add("a row").add("other row");
	 */
	public JqGridBean addRow(String row) {
		rows.add(row);
		return this;
	}

	/**
	 * 添加一行记录
	 * @param obj JSON对象,转换成字符串
	 * @return 当前数据源,方便链式写法 ds.add(obj1).add(obj2);
	 */
	public JqGridBean addRow(JqGridRowBean obj) {
		rows.add(obj);
		return this;
	}

	public int getRecords() {
		return records;
	}

	public void setRecords(int records) {
		this.records = records;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public List getRows() {
		return rows;
	}

	public void setRows(List rows) {
		this.rows = rows;
	}

	public JqGridUserData getUserdata() {
		return userdata;
	}

	public void setUserdata(JqGridUserData userdata) {
		this.userdata = userdata;
	}

}